const formatTime = date => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const hour = date.getHours()
  const minute = date.getMinutes()
  const second = date.getSeconds()
  let week = date.getDay()
  week = week == 1 ? '一' : week == 2 ? '二' : week == 3 ? '三' : week == 4 ? '四' : week == 5 ? '五' : week == 6 ? '六' : '日'
  
  return {
    year,
    month, 
    day, 
    hour, 
    minute, 
    second,
    week
  }
}

module.exports = {
  formatTime: formatTime
}
